

A = [xd(16,21) yd(16,21) 0 0 1 0;
     0 0 xd(16,21) yd(16,21) 0 1;
     xd(16,43) yd(16,43) 0 0 1 0;
     0 0 xd(16,43) yd(16,43) 0 1;
     xd(50,22) yd(50,22) 0 0 1 0;
     0 0 xd(50,22) yd(50,22) 0 1;];
 
 B = [DTX(16,21) DTY(16,21) DTX(16,43) DTY(16,43) DTX(50,22) DTY(50,22)]';
 
 H = A\B;